package org.jeecg.modules.sggg.mapper;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.sggg.entity.SgBlutdruckRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.sggg.entity.SgMember;
import org.jeecg.modules.sggg.entity.SgRemindRecord;

/**
 * @Description: 血压记录表
 * @Author: jeecg-boot
 * @Date: 2022-10-17
 * @Version: V1.0
 */
public interface SgBlutdruckRecordMapper extends BaseMapper<SgBlutdruckRecord> {

    List<SgMember> queryPageListBySql(Page<SgMember> page, String sysOrgCode, List<String> responsibleAgencies, Integer day, String roleCode, String userId,String name, String phone,boolean Bindstatus,int deviceType);

    IPage<SgBlutdruckRecord> queryList(Page<SgBlutdruckRecord> page, String orgCode, String memberId, String memberName, String memberPhone,List<String> responsibleAgencies, Integer intervene, String roleCode, String userId);

    SgBlutdruckRecord getAverageRecord(String memberId, Integer level);

    int getBlutdruckStatistics(String memberId, Integer level);

    SgBlutdruckRecord getBlutdruckStatisticsByDate(String memberId, String dateStartTime, String dateEndTime);

    /*大屏--高危干预预警*/
    List<Map<String, Object>> interventionWarning(String orgCode);

    /*大屏--三高管理人数*/
    List<Map<String, Object>> threeHighNumber(String orgCode);

    IPage<SgBlutdruckRecord> queryListByDoctor(Page<SgBlutdruckRecord> page, String name, String phone, String sysOrgCode, String roleCode,List<String> responsibleAgencies, String doctorId, String intervene);

    /*今日血压预警人数*/
    List<SgBlutdruckRecord> dayMeasureNumberCount(String sysOrgCode, String roleCode, String date, String doctorId, String intervene,List<String> responsibleAgencies);

    /*今日血压测量人数*/
    List<SgBlutdruckRecord> dayMeasureNumberCountTwo(String sysOrgCode, String roleCode, String date, String doctorId, String intervene,List<String> responsibleAgencies);

    List<SgBlutdruckRecord> queryaddressCount();

    /*查询本年度三高总人数*/
    Integer getYearSgCount(Integer yearDate);

    /*查询本年度未超出血压预警总人数*/
    Integer getMonthSgCount(Integer yearDate);

    List<SgBlutdruckRecord> getMonthControlRate(Integer yearDate);

    List<SgBlutdruckRecord> getXyMonthControlRate(Integer yearDate);

    List<Map<String, Integer>> getEachLevelNum(String orgCode);
}
